run counter to

Be in conflict with, oppose, as in Practice often runs counter to theory. This idiom, first recorded in 1843, uses counter in the sense of “in an opposite direction.”